import Vue from 'vue';
import Router from 'vue-router';

Vue.use(Router);

export default new Router({
    routes: [
        {
            path: '/login',
            component: resolve => require(['../components/page/Login.vue'], resolve),
        },
        {
            path: '/home',  //主页，common的home组件渲染的框架
            component: resolve => require(['../components/common/Home.vue'], resolve),
            name: '个人中心',
            meta: { title: '个人中心' },
            children: [
                {
                    path: '/',
                    component: resolve => require(['../components/page/index.vue'], resolve),
                    meta: { title: 'index页' },

                },
                // {
                //     path: '/manager',
                //     // component: Layout,
                //     // redirect: '/manager/Upload',
                //     name: 'manager',
                //     meta: { title: 'manager', icon: 'el-icon-s-help' },
                //     children: [
                //         {
                //             path: '/upload',
                //             name: '文件上传',
                //             component: resolve => require(['../components/page/manager/Upload.vue'], resolve),       // Vue-Core-Image-Upload组件
                //             meta: { title: '文件上传' },
                //         }
                //     ]
                // },
                {
                    path: '/upload',
                    component: resolve => require(['../components/page/Upload.vue'], resolve),       // Vue-Core-Image-Upload组件

                    name: '文件上传',
                    meta: { title: '文件上传' },

                },
                {
                    path: '/userCenter',
                    component: resolve => require(['../components/page/UserCenter.vue'], resolve),    // 拖拽列表组件 
                },
                {
                    path: '/modifyUser',
                    component: resolve => require(['../components/page/ModifyUser.vue'], resolve),
                },
                {
                    path: '/modifyPassword',
                    component: resolve => require(['../components/page/ModifyPassword.vue'], resolve),
                },
                {
                    path: '/success',
                    component: resolve => require(['../components/page/Success.vue'], resolve),
                }
            ]
        },
        {
            path: '/register',
            component: resolve => require(['../components/page/Register.vue'], resolve)
        },
        {
            path: '/register-success',
            component: resolve => require(['../components/page/RegisterSuccess.vue'], resolve)
        },
        {
            path: '/login',
            component: resolve => require(['../components/page/Login.vue'], resolve)
        },
    ]
})
